home *** CD-ROM | disk | FTP | other *** search
- Path: news.intellinet.com!usenet
- From: JerryD@prodentec.com (Jerry Davis)
- Newsgroups: comp.lang.c
- Subject: Re: operator % - compiler error
- Date: Tue, 19 Mar 1996 20:05:18 GMT
- Organization: IntelliNet-ISP, LLC. 1-800-290-7677
- Message-ID: <4in0ih$o43@zeus.intellinet.com>
- References: <4ihuuh$6ul@hatathli.csulb.edu>
- NNTP-Posting-Host: 204.214.231.27
- X-Newsreader: Forte Free Agent 1.0.82
-
- davidcho@csulb.edu (David Cho) wrote:
-
- >When I try to compile, I get an erro message for the following line:
-
-
- >x=663608941*y%pow(2,32) /*I want remainder*/
-
- >But the error message says "illegal use of floating point". What does
- >that mean? Isn't % used a an operator to calcuate the remainder?
-
- In Microsoft and Borland, the pow() function takes two doubles and
- returns a double. The % operator can't take a double in either
- argument, thus causing the error. Try casting it like such:
- x=663608941*y%(long)pow(2,32);
-
- Jerry Davis
- jerryd@intellinet.com
- jerryd@prodentec.com
-
-
-